import subprocess
import configparser

config = configparser.ConfigParser()
config.read('../Config/config.ini')

batch_file = config.get('EngineInfo', 'engine_path') + "/Engine/Build/BatchFiles/RunUAT.bat"
plugin = input("Enter plugin location (with .uplugin) : ")
rebuild_folder = input("Enter rebuild plugin location : ")

command = [
    batch_file,
    "BuildPlugin",
    "-plugin={}".format(plugin),
    "-package={}".format(rebuild_folder)
]

if __name__ == '__main__':
    subprocess.call(command)
